home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
demo
/
wemdemo3.zip
/
ETC
/
EMACS.INI
< prev
next >
Wrap
Lisp/Scheme
|
1994-09-21
|
10KB
|
248 lines
;;; -*- Mode: Emacs-Lisp -*-
;;; This is a sample emacs.ini file.
;;;
;;; The emacs.ini file, which should reside in your Emacs home directory
;;; (defined by the EMACSHOME environment variable, which defaults to C:\),
;;; allows you to customize the behavior of Emacs. In general, changes to
;;; your emacs.ini file will not take effect until the next time you start
;;; up Emacs. You can load it explicitly with
;;; `M-x load-file RET c:\emacs.ini RET'. (You may have to correct the
;;; pathname.)
;;;
;;; There is a great deal of documentation on customization in the Emacs
;;; manual. You can read this manual with the online Info browser: type
;;; `C-h i' or select "Emacs Info" from the "Help" menu.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Basic Customization ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Older versions of emacs did not have these variables
;;; (emacs-major-version and emacs-minor-version.)
;;; Let's define them if they're not around, since they make
;;; it much easier to conditionalize on the emacs version.
(if (and (not (boundp 'emacs-major-version))
(string-match "^[0-9]+" emacs-version))
(setq emacs-major-version
(string-to-int (substring emacs-version
(match-beginning 0) (match-end 0)))))
(if (and (not (boundp 'emacs-minor-version))
(string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version))
(setq emacs-minor-version
(string-to-int (substring emacs-version
(match-beginning 1) (match-end 1)))))
(setq running-xemacs (string-match "Lucid" emacs-version))
(setq running-emacs-19 (>= emacs-major-version 19))
(setq running-fsf-emacs-19 (and running-emacs-19 (not running-xemacs)))
(setq running-emacs-18 (< emacs-major-version 19))
(setq running-x (eq window-system 'x))
;; Enable the commands `narrow-to-region' ("C-x n n") and
;; `eval-expression' ("M-ESC", or "ESC ESC"). Both are useful
;; commands, but they can be confusing for a new user, so they're
;; disabled by default.
(put 'narrow-to-region 'disabled nil)
(put 'eval-expression 'disabled nil)
;; Make the sequence "C-x C-j" execute the `goto-line' command,
;; which prompts for a line number to jump to.
(global-set-key "\C-x\C-j" 'goto-line)
(cond (running-xemacs
;;
;; Code for any version of Lucid Emacs goes here
;;
;; Change the values of some variables.
;; (t means true; nil means false.)
;;
;; Use the "Describe Variable..." option on the "Help" menu
;; to find out what these variables mean.
(setq find-file-use-truenames nil
find-file-compare-truenames t
minibuffer-confirm-incomplete t
complex-buffers-menu-p t
)
(cond (running-x
;;
;; Code which applies only when running emacs under X goes here.
;; (Currently, this is always the case in lemacs, but it will
;; not be in the future.)
;;
;; Remove the binding of C-x C-c, which normally exits emacs.
;; It's easy to hit this by mistake, and that can be annoying.
;; Under X, you can always quit with the "Exit Emacs" option on
;; the File menu.
;; (global-set-key "\C-x\C-c" nil)
;; This changes the variable which controls the text that goes
;; in the top window title bar. (However, it is not changed
;; unless it currently has the default value, to avoid
;; interfering with a -wn command line argument I may have
;; started emacs with.)
(if (equal screen-title-format "%S: %b")
(setq screen-title-format
(concat "%S [" emacs-version "]"
(if nil ; (getenv "NCD")
""
" %b"))))))
;;
;; (The following code applies whether or not we're running X.)
;;
;; Change the binding of mouse button 2, so that it inserts the
;; selection at point (where the text cursor is), instead of at
;; the position clicked.
;;
;; Note that you can find out what a particular key sequence or
;; mouse button does by using the "Describe Key..." option on
;; the Help menu.
(define-key global-map 'button2 'x-insert-selection)
;; LISPM bindings of Control-Shift-C and Control-Shift-E.
;; Note that "\C-C" means Control-C, not Control-Shift-C.
;; To specify shifted control characters, you must use the
;; more verbose syntax used here.
(define-key emacs-lisp-mode-map '(control C) 'compile-defun)
(define-key emacs-lisp-mode-map '(control E) 'eval-defun)
;; Make F5 be `undo'
(global-set-key 'f5 'undo)
;; Make F6 be `save-file' followed by `delete-window'.
(global-set-key 'f6 "\C-x\C-s\C-x0")
;; Make `C-x C-m' and `C-x RET' be different (since I tend to type
;; the latter by accident sometimes.)
(define-key global-map [(control x) return] nil)
;; Add `dired' to the File menu
(add-menu-item '("File") "Edit Directory" 'dired t)
))
(cond ((and running-xemacs
(>= emacs-major-version 19)
(>= emacs-minor-version 6))
;;
;; Code which requires Lucid Emacs version 19.6 or newer goes here
;;
))
(cond (running-emacs-19
;;
;; Code for any vintage-19 emacs goes here
;;
))
(cond (running-fsf-emacs-19
;;
;; Code specific to FSF Emacs 19 (not Lucid Emacs) goes here
;;
))
(cond (running-emacs-19
;;
;; Code specific to emacs 18 goes here
;;
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Customization of Specific Packages ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ********************
;;; Load a partial-completion mechanism, which makes minibuffer completion
;;; search multiple words instead of just prefixes; for example, the command
;;; `M-x byte-compile-and-load-file RET' can be abbreviated as `M-x b-c-a RET'
;;; because there are no other commands whose first three words begin with
;;; the letters `b', `c', and `a' respectively.
;;;
(load-library "completer")
;;; ********************
;;; Edebug is a source-level debugger for emacs-lisp programs.
;;;
(define-key emacs-lisp-mode-map "\C-xx" 'edebug-defun)
;;; ********************
;;; Font-Lock is a syntax-highlighting package. When it is enabled and you
;;; are editing a program, different parts of your program will appear in
;;; different fonts or colors. For example, with the code below, comments
;;; appear in red italics, function names in function definitions appear in
;;; blue bold, etc. The code below will cause font-lock to automatically be
;;; enabled when you edit C, C++, Emacs-Lisp, and many other kinds of
;;; programs.
;; Definition stolen from later versions of font-lock.
(defun turn-on-font-lock ()
(font-lock-mode 1))
(require 'font-lock)
(cond (running-xemacs
;; font-lock exists under FSF Emacs 19 but the faces
;; are handled differently, and I don't feel like
;; porting the code now.
(set-face-foreground 'font-lock-function-name-face "blue")
(set-face-foreground 'font-lock-comment-face "red")
(set-face-foreground 'font-lock-string-face "forest green")
(set-face-underline-p 'font-lock-string-face nil)
(make-face-unitalic 'font-lock-string-face)
(make-face-unitalic 'font-lock-function-name-face)
(make-face-unitalic 'font-lock-comment-face)
(copy-face 'font-lock-function-name-face 'font-lock-keyword-face)
(copy-face 'font-lock-string-face 'font-lock-doc-string-face)
(copy-face 'font-lock-string-face 'font-lock-type-face))
(running-fsf-emacs-19
(make-face 'my-red-face)
(set-face-foreground 'my-red-face "red")
(make-face 'my-green-face)
(set-face-foreground 'my-green-face "green")
(make-face 'my-blue-face)
(set-face-foreground 'my-blue-face "blue")
(setq font-lock-function-name-face 'my-blue-face)
(setq font-lock-comment-face 'my-red-face)
(setq font-lock-string-face 'my-green-face)
(setq font-lock-keyword-face 'my-blue-face)
(setq font-lock-doc-string-face 'my-green-face)
(setq font-lock-type-face 'my-green-face)))
(add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock)
(add-hook 'lisp-mode-hook 'turn-on-font-lock)
(add-hook 'c-mode-hook 'turn-on-font-lock)
(add-hook 'c++-mode-hook 'turn-on-font-lock)
(add-hook 'perl-mode-hook 'turn-on-font-lock)
(add-hook 'tex-mode-hook 'turn-on-font-lock)
(add-hook 'texinfo-mode-hook 'turn-on-font-lock)
;;; ********************
;;; Automatically save and restore the "context" (i.e. files visited
;;; and window/file configuration) when Emacs exits and starts up
;;; again. (Bug in package: only the context of the screen that is
;;; current when you exit will be saved.)
;;;
; uncomment the following lines to enable the package.
;(require 'saveconf)
;(if (null (cdr command-line-args))
; (setq inhibit-startup-message (recover-context)))
;;; If you leave the following line commented out but uncomment the
;;; previous ones, the context will not automatically be saved, but
;;; the last saved context will automatically be restored. Then you
;;; save the context when you want, using `M-x save-context'.
;(setq auto-save-and-recover-context t)